package cn.hanyx.vlog.bussiness.controller;

import cn.hanyx.vlog.api.vo.Order;
import cn.hanyx.vlog.bussiness.service.BussinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * BussinessController
 *
 * @author hanyx
 * @date 2021/11/28
 */
@RestController
@RequestMapping("/sale")
public class BussinessController {

    @Autowired
    private BussinessService bussinessService;

    @GetMapping
    public void test() {
        Order order = new Order();
        order.setUsername("zhangsan"); // 用户名
        order.setGoodsCode("coke"); // 商品
        order.setQuantity(100); // 购买数量
        order.setAmount(3000f); // 商品总价
        order.setPoints(0);
        bussinessService.sale(order);
    }

}
